package jw.repository.product;


import jw.model.product.WxProductImage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface WxProductImageRepository extends JpaRepository<WxProductImage,Integer>, JpaSpecificationExecutor<WxProductImage> {

    @Query("select p from WxProductImage p where p.productId =?1 and p.isHomePage =?2 order by p.sort asc")
    List<WxProductImage> findByProductIdAndIsHomePage(Integer productId,Integer isHomePage);

}
